null-terminated-str 0.1.4

FFI-friendly utf-8 string, enabling const null-terminated str and caching of the non-terminated string to avoid frequent allocation.
Documentation

null-terminated-str

Rust

crate.io downloads

crate.io version

docs

Provides null terminated utf-8 str NullTerminatedStr (borrowed) and NullTerminatedString (owned) that is compatible with

  • std::ffi::CStr
  • std::ffi::CString
  • str
  • String

Also provides const_null_terminated_str! to create NullTerminatedStr at compile time and IntoNullTerminatedString that accepts &str, String, &NullTerminatedStr and NullTerminatedString to avoid frequent allocation in FFI call.